package com.axzh.interview.base;

public class InsertionSort {

	public static void main(String[] args) {
		int[] a = {2,31,24,98,76,11,74,12,33};
		for(int i=0;i<a.length;i++) {
			for(int j=i;j>0;j--) {
				if(a[j]<a[j-1]) {
					int tmp = a[j];
					a[j]=a[j-1];
					a[j-1]=tmp;
				}
			}
		}
		for(int i:a) {
			System.out.print(i+" ");
		}
	}

}
